/**
 * 
 */
function Userlogin(){
	var user = {
			userid:"root",
			password:1,
	}
	$.ajax({
		cache:false,
		type:'post',
		url:"/graduationProject/Userlogin",
		contentType:'application/json;charset=utf-8', 
		traditional:true,
		dataType:"JSON",
		data:JSON.stringify(user),
		success:function(data){
		},	
		error:function(data, XMLHttpRequest, textStatus, errorThrown){  
			}  
	}) 
}
function findUserByid(){
	var user = {
			id:5,
	}
	$.ajax({
		cache:false,
		type:'post',
		url:"/graduationProject/findUserByid",
		contentType:'application/json;charset=utf-8', 
		traditional:true,
		dataType:"JSON",
		data:JSON.stringify(user),
		success:function(data){
		},	
		error:function(data, XMLHttpRequest, textStatus, errorThrown){  
			}  
	}) 
}
function updataUser(){
	var formData = new FormData();
	formData.append("id",7);
	formData.append("fileimg",previewImg.files[0]);
	formData.append("username","sss");
	formData.append("password","sss");
	formData.append("sex","sss");
	formData.append("birthday","2018-02-26");
	formData.append("number","11");
	formData.append("telephone","11");
	formData.append("post","1");
	formData.append("department","1221");
	formData.append("type","1");
	formData.append("userid","12");
	formData.append("startDate","2018-02-26");
	formData.append("endDate","2018-02-26");
	formData.append("salary","12");
	$.ajax({
		cache:false,
		type:'post',
		dataType:"JSON",
		url:"/graduationProject/updataUser",
		contentType:'application/json;charset=utf-8', 
		traditional:true,
		contentType: false,  
        processData: false,  
		data:formData,
		success:function(data){
		},	
		error:function(data, XMLHttpRequest, textStatus, errorThrown){  
			}  
	}) 
}
function DeleteUser(){
	var user = {
			id:4,
	}
	$.ajax({
		cache:false,
		type:'post',
		url:"/graduationProject/DeleteUser",
		contentType:'application/json;charset=utf-8', 
		traditional:true,
		dataType:"JSON",
		data:JSON.stringify(user),
		success:function(data){
		},	
		error:function(data, XMLHttpRequest, textStatus, errorThrown){  
			}  
	}) 
}
function insertUser(){
	var formData = new FormData();
	formData.append("fileimg",previewImg.files[0]);
	formData.append("username","sss");
	formData.append("password","sss");
	formData.append("sex","sss");
	formData.append("birthday","2018-02-26");
	formData.append("number","11");
	formData.append("telephone","11");
	formData.append("post","1");
	formData.append("department","1221");
	formData.append("type","1");
	formData.append("userid","12");
	formData.append("startDate","2018-02-26");
	formData.append("endDate","2018-02-26");
	formData.append("salary","12");
	$.ajax({
		cache:false,
		type:'post',
		dataType:"JSON",
		url:"/graduationProject/insertUser",
		contentType:'application/json;charset=utf-8', 
		traditional:true,
		contentType: false,  
        processData: false,  
		data:formData,
		success:function(data){
		},	
		error:function(data, XMLHttpRequest, textStatus, errorThrown){  
			}  
	}) 
}
function findAllUser(){
	var user = {
		department:"暂无",
		sex:"男",
		username:1,
	}
	var userMap = {
			user : user,
			page:1,
			pageSize:2,
	}
	$.ajax({
		cache:false,
		type:'post',
		url:"/graduationProject/findAllUser",
		contentType:'application/json;charset=utf-8', 
		traditional:true,
		dataType:"JSON",
		data:JSON.stringify(userMap),
		success:function(data){
		},	
		error:function(data, XMLHttpRequest, textStatus, errorThrown){  
			}  
	}) 
}